package com.wu.company.entity;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * POJO类Utigrade
 */
@Entity
@Table(name = "UTIGRADE")
public class Utigrade implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	/** 属性岗位代码 */
	private String gradeCode;

	/** 属性岗位名称 */
	private String gradeName;

	/** 属性备注 */
	private String remark;

	/** 属性标志 */
	private String flag;

	/** 属性岗位级别 */
	private String gradeLevel;

	/** 属性utiusergrades */
	private List<Utiusergrade> utiusergrades = new ArrayList<Utiusergrade>(0);
	
	private List<Utigradetask> utigradetasks = new ArrayList<Utigradetask>(0);

	/**
	 * 类Utigrade的默认构造方法
	 */
	public Utigrade() {
	}

	/**
	 * 属性岗位代码的getter方法
	 */
	@Id
	@Column(name = "GRADECODE")
	public String getGradeCode() {
		return this.gradeCode;
	}

	/**
	 * 属性岗位代码的setter方法
	 */
	public void setGradeCode(String gradeCode) {
		this.gradeCode = gradeCode;
	}

	/**
	 * 属性岗位名称的getter方法
	 */

	@Column(name = "GRADENAME")
	public String getGradeName() {
		return this.gradeName;
	}

	/**
	 * 属性岗位名称的setter方法
	 */
	public void setGradeName(String gradeName) {
		this.gradeName = gradeName;
	}

	/**
	 * 属性备注的getter方法
	 */

	@Column(name = "REMARK")
	public String getRemark() {
		return this.remark;
	}

	/**
	 * 属性备注的setter方法
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * 属性标志的getter方法
	 */

	@Column(name = "FLAG")
	public String getFlag() {
		return this.flag;
	}

	/**
	 * 属性标志的setter方法
	 */
	public void setFlag(String flag) {
		this.flag = flag;
	}

	/**
	 * 属性岗位级别的getter方法
	 */

	@Column(name = "GRADELEVEL")
	public String getGradeLevel() {
		return this.gradeLevel;
	}

	/**
	 * 属性岗位级别的setter方法
	 */
	public void setGradeLevel(String gradeLevel) {
		this.gradeLevel = gradeLevel;
	}

	/**
	 * 属性utiusergrades的getter方法
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "utigrade")
	@Fetch(value= FetchMode.SELECT)
	public List<Utiusergrade> getUtiusergrades() {
		return utiusergrades;
	}

	/**
	 * 属性utiusergrades的setter方法
	 */
	public void setUtiusergrades(List<Utiusergrade> utiusergrades) {
		this.utiusergrades = utiusergrades;
	}

	@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER, mappedBy = "utigrade")
	@Fetch(value= FetchMode.SELECT)
	public List<Utigradetask> getUtigradetasks() {
		return utigradetasks;
	}

	public void setUtigradetasks(List<Utigradetask> utigradetasks) {
		this.utigradetasks = utigradetasks;
	}

}
